home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume2 / dungeon / sysvr3 < prev   
Encoding:
Internet Message Format  |  1990-12-13  |  28.0 KB

  1. Path: uunet!tektronix!tekgen!tekred!games
  2. From: games@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v05i085:  dungeon - game of adventure, SysVR3 patches
  5. Message-ID: <3253@tekred.TEK.COM>
  6. Date: 8 Nov 88 17:30:55 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 986
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted by: Roger Noe <rjnoe@arrakis.ece.uiuc.edu>
  12. Comp.sources.games: Volume 5, Issue 85
  13. Archive-name: dungeon/SysVR3pch
  14.  
  15.     [Here is a set a patches supplied by Roger Noe, to make the Unix
  16.      f77 version of dungeon compile and run under System V Rel 3.0.
  17.      Not having this OS, I am not able to try them out so you are on your
  18.      own.  -br]
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of shell archive."
  27. # Contents:  SysVR3.pch
  28. # Wrapped by billr@saab on Tue Nov  8 09:26:35 1988
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'SysVR3.pch' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'SysVR3.pch'\"
  32. else
  33. echo shar: Extracting \"'SysVR3.pch'\" \(26146 characters\)
  34. sed "s/^X//" >'SysVR3.pch' <<'END_OF_FILE'
  35. X*** README.rjnoe.orig    Fri Oct 28 11:36:38 1988
  36. X--- README.rjnoe    Fri Oct 28 11:36:38 1988
  37. X***************
  38. X*** 0
  39. X
  40. X--- 1,144 -----
  41. X+ I have attempted porting the UNIX F77 version of Dungeon - which you posted
  42. X+ to Usenet about a year ago - to the AT&T 3B2/400 running UNIX System V
  43. X+ Release 3.0.  What follows is a description of some of the things I needed
  44. X+ to change just to get it running on my system.  I hope you find it useful.
  45. X+ The base patch level I worked from was 3 (including the "3.1" patch).
  46. X+ 
  47. X+ 1. Different F77 Compilation System
  48. X+ First off, this UNIX system does not use the FORTRAN 77 compiler and
  49. X+ archive libraries used on previous versions of System V.  What I have is
  50. X+ called FORTRAN 77 XLA+ Compilation System, Issue 1 Version 0.  The F77
  51. X+ used on previous UNIX machines is sometimes called f77 1.1.  This difference
  52. X+ required several changes to Makefile.sysv.  Both the command to invoke
  53. X+ the compiler and options recognized by the compiler are different.
  54. X+ I have learned that there is a newer version of F77-XLA+ available from
  55. X+ AT&T; some of the problems I mention below might be fixed in that version.
  56. X+ 
  57. X+ 2. No LOGICAL Arguments to Bitwise Intrinsic Functions
  58. X+ The F77-XLA+ compiler is picky about LOGICAL type arguments being passed
  59. X+ to the intrinsic bitwise (INTEGER) functions and(), or(), and not().  This
  60. X+ was very easily fixed by translating to the logical operators .AND., .OR.,
  61. X+ and .NOT..
  62. X+ 
  63. X+ 3. No INTEGER Arguments to ichar() Intrinsic Function
  64. X+ The F77-XLA+ compiler is picky about INTEGER arguments passed to ichar().
  65. X+ They were redundant calls in all cases I found.  (Just the INW() and UINW()
  66. X+ arrays were involved.)
  67. X+ 
  68. X+ 4. No $ Edit Descriptor in FORMAT Statements
  69. X+ The F77-XLA+ compiler does not recognize the $ in FORMAT statements as a
  70. X+ means of suppressing newline at the end of an output operation.  This was
  71. X+ apparently not an oversight; they documented its absence.  I have found some
  72. X+ vestiges of the code which would have implemented it (e.g. an external symbol
  73. X+ in the I/O library called "F77nonl") but the capability is just not there.
  74. X+ I can find no substitute and have been putting up with having my ">" game
  75. X+ prompt not appear on the same line as my input.
  76. X+ 
  77. X+ 5. FUNCTION INIT() Name Conflict
  78. X+ The external symbol "init" is used in the F77-XLA+ I/O library libfortI77.a
  79. X+ to indicate whether or not it has been initialized in the current process.
  80. X+ I merely changed the Dungeon function name to DINIT.
  81. X+ 
  82. X+ 6. CLOSE() with Long Filename Causes Fatal Run-time Errors
  83. X+ There is a bug in the F77-XLA+ I/O library libfortI77.a that occurs when
  84. X+ trying to CLOSE() a unit that had been OPENed to a UNIX file with a long
  85. X+ pathname.  Think of the F77 I/O subsystem as overlying the standard I/O
  86. X+ (stdio) subsystem.  A F77 OPEN eventually calls fopen(3S) [3S: in the stdio
  87. X+ library] and stores the FILE * pointer which fopen returns into an element
  88. X+ of an array of structures corresponding to the unit number OPENed.  When
  89. X+ the unit is CLOSEd, the file name passed to OPEN is copied into a character
  90. X+ array within this same structure, using strcpy(3C) [3C: in the C library].
  91. X+ (I assume this is to allow future reOPENing of the file, but haven't really
  92. X+ looked into this much.)  No bounds or string length checking is done.  So
  93. X+ when the filename is long (as might be expected for INDXFILE or TEXTFILE),
  94. X+ this overwrites the next F77 I/O unit structure with garbage.  If the next
  95. X+ unit was being used, the pointer to the corresponding stdio structure is now
  96. X+ gone.  If not, the next unit now appears to be in use because the FILE *
  97. X+ is no longer a NULL pointer and when the F77 code exits normally (e.g.
  98. X+ through STOP) it will try to clean up this unit.  These considerations
  99. X+ led me to make the following changes:
  100. X+ 
  101. X+     Since INDXFILE and TEXTFILE could not be CLOSEd once OPENed, I
  102. X+     moved INDXFILE from unit 1 to unit 3.  Unit 1 is now used only
  103. X+     for "dsave.dat", which is short enough that it can be closed and
  104. X+     opened normally.  TEXTFILE remains at unit 2.
  105. X+ 
  106. X+     I dropped my exit.F source file containing SUBROUTINE EXIT (which
  107. X+     consisted entirely of one executable statement, STOP) and replaced
  108. X+     it with exit.c containing the C function void exit_().  Since STOP
  109. X+     tries to clean up F77 I/O unit structures that have been OPENed,
  110. X+     I circumvent this by doing a CALL EXIT in F77 which invokes the
  111. X+     C function exit_() on my system.  The latter function simply calls
  112. X+     exit() in the C/stdio library, cleans up the stdio structures and
  113. X+     terminates the process without mucking with the screwy F77 I/O
  114. X+     subsystem.
  115. X+ 
  116. X+ 7. CHARACTER Arguments Passed Inconsistently
  117. X+ The F77-XLA+ documentation indicates that a CHARACTER variable (or an
  118. X+ array of CHARACTER variables) is not quite passed by reference.  Instead
  119. X+ of just passing the address of the variable (or base address of the array),
  120. X+ effectively what is passed is a pointer to a structure containing (in C):
  121. X+ struct { char *s; long l; } where s is the pointer to the CHARACTER variable
  122. X+ (or array) and l is its length.  So dereferencing the passed pointer once
  123. X+ will give you s, the address of the CHARACTER variable.  All fine and dandy,
  124. X+ but they DIDN'T TELL THE PEOPLE WHO CODED THE I/O LIBRARY!  When a CHARACTER
  125. X+ array is passed to READ(), it interprets the structure pointer passed as the
  126. X+ address of the variable and starts overwriting the wrong place.  The one place
  127. X+ I found this was in RDLINE() and I fixed it by changing the READ() BUFFER to
  128. X+ use an implied DO loop.  What can I say, at least it works.
  129. X+ 
  130. X+ 8. Large Amounts of I/O in One Statement Fail
  131. X+ There appears to be some not easily identifiable bug in the F77-XLA+ I/O
  132. X+ library which causes it to abort when writing large amounts of data in
  133. X+ one single WRITE().  I found this when attempting to save the game in
  134. X+ dsave.dat.  I separated the largest arrays (notably the COMMON /OBJCTS/
  135. X+ arrays) into individual WRITEs and haven't had any further problems.
  136. X+ I changed the READs (for game restoration) to be identical, just for
  137. X+ consistency's sake.
  138. X+ 
  139. X+ 
  140. X+ There are probably other bugs I have not yet discovered.  Already I am
  141. X+ suspicious of the random number generation on my system since I've never
  142. X+ had to take more than one whack at the troll before he's knocked out.
  143. X+ I'll keep looking at things like that and keep you posted, if you like.
  144. X+ 
  145. X+ 
  146. X+ There are also a few other things my compiler complains about that I did not
  147. X+ bother to fix:
  148. X+ 
  149. X+ The C preprocessor (/lib/cpp) in System V Release 3 warns about extra
  150. X+ tokens on cpp lines like #else, #elif, and #endif.  One way to suppress
  151. X+ these warnings is to add /* comment */ delimiters around the offending token:
  152. X+     #ifdef PDP
  153. X+     ...
  154. X+     #else /* PDP */
  155. X+     ...
  156. X+     #endif /* PDP */
  157. X+ 
  158. X+ The F77-XLA+ compiler warns about a duplicate type statement for PRSWON in
  159. X+ FUNCTION BLOW in demons.F.  Since PRSWON is already declared in parser.h, it
  160. X+ need not be declared again in demons.F, as it #includes parser.h.
  161. X+ 
  162. X+ The F77-XLA+ compiler complains if the last statement before END in each
  163. X+ FUNCTION is not a RETURN.  Specifically, in the following:
  164. X+         BALLOP in ballop.F
  165. X+         DINIT in dinit.F
  166. X+         LEX in np.F
  167. X+         SPARSE in np1.F
  168. X+         CYCLOP in villns.F
  169. X+ DINIT has FORMAT statements between RETURN and END, CYCLOP has a computed
  170. X+ GOTO just before the END, and the others all have unconditional GOTOs just
  171. X+ before their ENDs.  If you ask me, the F77-XLA+ compiler is being a little
  172. X+ weird here.
  173. X+ 
  174. X+ If there's anything I can do to help out with Dungeon, please let me know.
  175. X+ If no one else has done it, I'm toying with the idea of porting it to C.
  176. X+ Please let me know your opinion on that.  Thanks.
  177. X+ --
  178. X+     Roger Noe            rjnoe@arrakis.ece.uiuc.edu
  179. X+     University of Illinois
  180. X+     Department of Electrical and Computer Engineering
  181. X+     248 Everitt Laboratory
  182. X+     1406 West Green Street
  183. X+     Urbana, IL  61801  USA        40:06:39 N.  88:13:41 W.
  184. X+     +1 217 333 3496
  185. X*** Makefile.sysv.orig    Mon Oct 24 15:28:55 1988
  186. X--- Makefile.sysv    Mon Oct 24 15:28:54 1988
  187. X***************
  188. X*** 1,3
  189. X  # Makefile for creating dungeon
  190. X  # Edit BIN DDIR and FFLAGS suitable for your system
  191. X  # Also, if you are running System V change the .F.o production
  192. X
  193. X--- 1,4 -----
  194. X+ F77 = fort
  195. X  # Makefile for creating dungeon
  196. X  # Edit BIN DDIR and FFLAGS suitable for your system
  197. X  # Also, if you are running System V change the .F.o production
  198. X***************
  199. X*** 11,17
  200. X  #    f77 -c $(FFLAGS) $*.F
  201. X  # For System V use the following production instead:
  202. X      @/lib/cpp $(CPPFLAGS) $*.F > $*.f
  203. X!     f77 -c $(FFLAGS) $*.f
  204. X      rm $*.f
  205. X  
  206. X  # define SYSV if running System V or V7
  207. X
  208. X--- 12,18 -----
  209. X  #    f77 -c $(FFLAGS) $*.F
  210. X  # For System V use the following production instead:
  211. X      @/lib/cpp $(CPPFLAGS) $*.F > $*.f
  212. X!     $(F77) -c $(FFLAGS) $*.f
  213. X      rm $*.f
  214. X  
  215. X  # define SYSV if running System V or V7
  216. X***************
  217. X*** 24,30
  218. X  #FOPTS = -q # -g -Ddebug
  219. X  # use -Nn650 for System V to increase default symbol table size
  220. X  # also, no -g flag (causes runtime errors)
  221. X! FOPTS = -q -Nn650
  222. X  # f77 compiler flags for pdp (64K split I/D)
  223. X  #FOPTS = -q -I2 -L1 -i -DPDP # -Ddebug
  224. X  FFLAGS = -O $(FOPTS)
  225. X
  226. X--- 25,32 -----
  227. X  #FOPTS = -q # -g -Ddebug
  228. X  # use -Nn650 for System V to increase default symbol table size
  229. X  # also, no -g flag (causes runtime errors)
  230. X! #FOPTS = -q -Nn650
  231. X! FOPTS = 
  232. X  # f77 compiler flags for pdp (64K split I/D)
  233. X  #FOPTS = -q -I2 -L1 -i -DPDP # -Ddebug
  234. X  FFLAGS = -O $(FOPTS)
  235. X***************
  236. X*** 51,57
  237. X  FSRC =  actors.F ballop.F clockr.F demons.F\
  238. X      dgame.F dinit.F dmain.F dso1.F dso2.F\
  239. X      dso3.F dso4.F dso5.F dso6.F dso7.F\
  240. X!     dsub.F dverb1.F dverb2.F exit.F gdt.F lightp.F\
  241. X      nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  242. X      rooms.F sobjs.F sverbs.F verbs.F villns.F
  243. X  
  244. X
  245. X--- 53,59 -----
  246. X  FSRC =  actors.F ballop.F clockr.F demons.F\
  247. X      dgame.F dinit.F dmain.F dso1.F dso2.F\
  248. X      dso3.F dso4.F dso5.F dso6.F dso7.F\
  249. X!     dsub.F dverb1.F dverb2.F gdt.F lightp.F\
  250. X      nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  251. X      rooms.F sobjs.F sverbs.F verbs.F villns.F
  252. X  
  253. X***************
  254. X*** 55,61
  255. X      nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  256. X      rooms.F sobjs.F sverbs.F verbs.F villns.F
  257. X  
  258. X! CSRC =    cinit.c cio.c cspeak.c decode.c lex.c listen.c rtim.c
  259. X  
  260. X  OBJS =  actors.o ballop.o clockr.o demons.o\
  261. X      dgame.o dinit.o dmain.o dso1.o dso2.o\
  262. X
  263. X--- 57,63 -----
  264. X      nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  265. X      rooms.F sobjs.F sverbs.F verbs.F villns.F
  266. X  
  267. X! CSRC =    cinit.c cio.c cspeak.c decode.c exit.c lex.c listen.c rtim.c
  268. X  
  269. X  OBJS =  actors.o ballop.o clockr.o demons.o\
  270. X      dgame.o dinit.o dmain.o dso1.o dso2.o\
  271. X***************
  272. X*** 72,78
  273. X  pdp:    dungpdp speak listen dtext.dat
  274. X  
  275. X  dungeon: $(OBJS)
  276. X!     f77 -o dungeon $(OBJS) $(LDFLAGS)
  277. X      @echo done
  278. X  
  279. X  dungpdp: $(OBJS) $(PDPOBJS)
  280. X
  281. X--- 74,80 -----
  282. X  pdp:    dungpdp speak listen dtext.dat
  283. X  
  284. X  dungeon: $(OBJS)
  285. X!     $(F77) -o dungeon $(OBJS) $(LDFLAGS)
  286. X      @echo done
  287. X  
  288. X  dungpdp: $(OBJS) $(PDPOBJS)
  289. X***************
  290. X*** 98,105
  291. X  dinit.o: dinit.F
  292. X  #    f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
  293. X  # For System V use the following instead:
  294. X!     @/lib/cpp $(CPPFLAGS) dinit.F > dinit.f
  295. X!     f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.f
  296. X      rm $*.f
  297. X  
  298. X  # uncomment the following for Suns to get around an optimizer bug
  299. X
  300. X--- 100,107 -----
  301. X  dinit.o: dinit.F
  302. X  #    f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
  303. X  # For System V use the following instead:
  304. X!     @/lib/cpp $(CPPFLAGS) -DDDIR=$(DDIR) $(WIZDEF) dinit.F > dinit.f
  305. X!     $(F77) -c $(FFLAGS) dinit.f
  306. X      rm $*.f
  307. X  
  308. X  # uncomment the following for Suns to get around an optimizer bug
  309. X*** dinit.F.orig    Mon Oct 24 15:28:55 1988
  310. X--- dinit.F    Mon Oct 24 15:28:55 1988
  311. X***************
  312. X*** 18,24
  313. X  C
  314. X  C DECLARATIONS
  315. X  C
  316. X!     LOGICAL FUNCTION INIT(X)
  317. X      IMPLICIT INTEGER (A-Z)
  318. X  #ifndef PDP
  319. X      LOGICAL PROTCT
  320. X
  321. X--- 18,24 -----
  322. X  C
  323. X  C DECLARATIONS
  324. X  C
  325. X!     LOGICAL FUNCTION DINIT(X)
  326. X      IMPLICIT INTEGER (A-Z)
  327. X  #ifndef PDP
  328. X      LOGICAL PROTCT
  329. X***************
  330. X*** 153,159
  331. X      FROMDR=0
  332. X      SCOLRM=0
  333. X      SCOLAC=0
  334. X!     INIT=.FALSE.        
  335. X      MLOC=MRB
  336. X  C
  337. X  C INIT, PAGE 4
  338. X
  339. X--- 153,159 -----
  340. X      FROMDR=0
  341. X      SCOLRM=0
  342. X      SCOLAC=0
  343. X!     DINIT=.FALSE.        
  344. X      MLOC=MRB
  345. X  C
  346. X  C INIT, PAGE 4
  347. X***************
  348. X*** 247,253
  349. X      HERE=AROOM(WINNER)
  350. X      THFPOS=OROOM(THIEF)
  351. X      BLOC=OROOM(BALLO)
  352. X!     INIT=.TRUE.
  353. X  #ifdef debug
  354. X  C
  355. X  C    Normally, PRSFLG is setable in gdt to allow seeing various
  356. X
  357. X--- 247,253 -----
  358. X      HERE=AROOM(WINNER)
  359. X      THFPOS=OROOM(THIEF)
  360. X      BLOC=OROOM(BALLO)
  361. X!     DINIT=.TRUE.
  362. X  #ifdef debug
  363. X  C
  364. X  C    Normally, PRSFLG is setable in gdt to allow seeing various
  365. X***************
  366. X*** 266,272
  367. X  1925    continue
  368. X      END
  369. X  #else PDP
  370. X! 10000    INIT=.FALSE.
  371. X  C                        !ASSUME INIT FAILS.
  372. X      MMAX=1050
  373. X  C                        !SET UP ARRAY LIMITS.
  374. X
  375. X--- 266,272 -----
  376. X  1925    continue
  377. X      END
  378. X  #else PDP
  379. X! 10000    DINIT=.FALSE.
  380. X  C                        !ASSUME INIT FAILS.
  381. X      MMAX=1050
  382. X  C                        !SET UP ARRAY LIMITS.
  383. X***************
  384. X*** 449,455
  385. X  C
  386. X  C NOW RESTORE FROM EXISTING INDEX FILE.
  387. X  C
  388. X!     OPEN(UNIT=1,file=INDXFILE,status='OLD',
  389. X  #ifdef XELOS
  390. X  &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900,recl=1)
  391. X  #else
  392. X
  393. X--- 449,455 -----
  394. X  C
  395. X  C NOW RESTORE FROM EXISTING INDEX FILE.
  396. X  C
  397. X!     OPEN(UNIT=3,file=INDXFILE,status='OLD',
  398. X  #ifdef XELOS
  399. X  &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900,recl=1)
  400. X  #else
  401. X***************
  402. X*** 455,462
  403. X  #else
  404. X  &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
  405. X  #endif
  406. X!     rewind(unit=1, err=1900)
  407. X!     READ(1,130) I,J,K
  408. X  C                        !GET VERSION.
  409. X      IF((I.NE.VMAJ).OR.(J.NE.VMIN))
  410. X  &        GO TO 1925
  411. X
  412. X--- 455,462 -----
  413. X  #else
  414. X  &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
  415. X  #endif
  416. X!     rewind(unit=3, err=1900)
  417. X!     READ(3,130) I,J,K
  418. X  C                        !GET VERSION.
  419. X      IF((I.NE.VMAJ).OR.(J.NE.VMIN))
  420. X  &        GO TO 1925
  421. X***************
  422. X*** 474,483
  423. X  150    FORMAT(' RESTORING FROM "dindx.dat"')
  424. X  #endif NOCC
  425. X  #endif debug
  426. X!     READ(1,130) MXSCOR,STRBIT,EGMXSC
  427. X!     READ(1,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
  428. X!     READ(1,130) XLNT,TRAVEL
  429. X!     READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  430. X  &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  431. X  &        OREAD
  432. X      READ(1,130) R2LNT,OROOM2,RROOM2
  433. X
  434. X--- 474,483 -----
  435. X  150    FORMAT(' RESTORING FROM "dindx.dat"')
  436. X  #endif NOCC
  437. X  #endif debug
  438. X!     READ(3,130) MXSCOR,STRBIT,EGMXSC
  439. X!     READ(3,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
  440. X!     READ(3,130) XLNT,TRAVEL
  441. X!     READ(3,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  442. X  &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  443. X  &        OREAD
  444. X      READ(3,130) R2LNT,OROOM2,RROOM2
  445. X***************
  446. X*** 480,491
  447. X      READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  448. X  &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  449. X  &        OREAD
  450. X!     READ(1,130) R2LNT,OROOM2,RROOM2
  451. X!     READ(1,130) CLNT,CTICK,CACTIO
  452. X!     READ(1,135) CFLAG
  453. X!     READ(1,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
  454. X!     READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  455. X!     READ(1,130) MBASE,MLNT,RTEXT
  456. X  C
  457. X      CLOSE(1)
  458. X      GO TO 1025
  459. X
  460. X--- 480,491 -----
  461. X      READ(3,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  462. X  &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  463. X  &        OREAD
  464. X!     READ(3,130) R2LNT,OROOM2,RROOM2
  465. X!     READ(3,130) CLNT,CTICK,CACTIO
  466. X!     READ(3,135) CFLAG
  467. X!     READ(3,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
  468. X!     READ(3,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  469. X!     READ(3,130) MBASE,MLNT,RTEXT
  470. X  C
  471. X  C    don't CLOSE index file, even though it won't be used again
  472. X  C
  473. X***************
  474. X*** 487,493
  475. X      READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  476. X      READ(1,130) MBASE,MLNT,RTEXT
  477. X  C
  478. X!     CLOSE(1)
  479. X      GO TO 1025
  480. X  C                        !INIT DONE.
  481. X  C
  482. X
  483. X--- 487,494 -----
  484. X      READ(3,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  485. X      READ(3,130) MBASE,MLNT,RTEXT
  486. X  C
  487. X! C    don't CLOSE index file, even though it won't be used again
  488. X! C
  489. X      GO TO 1025
  490. X  C                        !INIT DONE.
  491. X  C
  492. X***************
  493. X*** 511,517
  494. X      HERE=AROOM(WINNER)
  495. X      THFPOS=OROOM(THIEF)
  496. X      BLOC=OROOM(BALLO)
  497. X!     INIT=.TRUE.
  498. X  C
  499. X  #ifdef debug
  500. X      PRINT 1050,RLNT,RMAX,XLNT,XMAX,OLNT,OMAX,MLNT,MMAX,
  501. X
  502. X--- 512,518 -----
  503. X      HERE=AROOM(WINNER)
  504. X      THFPOS=OROOM(THIEF)
  505. X      BLOC=OROOM(BALLO)
  506. X!     DINIT=.TRUE.
  507. X  C
  508. X  #ifdef debug
  509. X      PRINT 1050,RLNT,RMAX,XLNT,XMAX,OLNT,OMAX,MLNT,MMAX,
  510. X*** dmain.F.orig    Mon Oct 24 15:28:56 1988
  511. X--- dmain.F    Mon Oct 24 15:28:55 1988
  512. X***************
  513. X*** 9,15
  514. X  C DECLARATIONS
  515. X  C
  516. X      IMPLICIT INTEGER (A-Z)
  517. X!     LOGICAL INIT
  518. X  #include "parser.h"
  519. X  #include "gamestate.h"
  520. X  #include "state.h"
  521. X
  522. X--- 9,15 -----
  523. X  C DECLARATIONS
  524. X  C
  525. X      IMPLICIT INTEGER (A-Z)
  526. X!     LOGICAL DINIT
  527. X  #include "parser.h"
  528. X  #include "gamestate.h"
  529. X  #include "state.h"
  530. X***************
  531. X*** 193,199
  532. X  C 1) INITIALIZE DATA STRUCTURES
  533. X  C 2) PLAY GAME
  534. X  C
  535. X!     IF(INIT(X)) CALL GAME
  536. X  C                        !IF INIT, PLAY GAME.
  537. X      CALL EXIT
  538. X  C                        !DONE
  539. X
  540. X--- 193,199 -----
  541. X  C 1) INITIALIZE DATA STRUCTURES
  542. X  C 2) PLAY GAME
  543. X  C
  544. X!     IF(DINIT(X)) CALL GAME
  545. X  C                        !IF INIT, PLAY GAME.
  546. X      CALL EXIT
  547. X  C                        !DONE
  548. X*** dso3.F.orig    Mon Oct 24 15:28:56 1988
  549. X--- dso3.F    Mon Oct 24 15:28:56 1988
  550. X***************
  551. X*** 64,70
  552. X  C OBJECT IS ON LIST... IS IT A MATCH?
  553. X  C
  554. X        IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
  555. X!       IF(and(not(NOCARE),(and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
  556. X  &        ((and(OFLAG1(I),F1).EQ.0).AND.
  557. X  &         (and(OFLAG2(I),F2).EQ.0))) GO TO 500
  558. X        IF(FWIM.EQ.0) GO TO 400
  559. X
  560. X--- 64,70 -----
  561. X  C OBJECT IS ON LIST... IS IT A MATCH?
  562. X  C
  563. X        IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
  564. X!       IF( ((.NOT. NOCARE) .AND. (and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
  565. X  &        ((and(OFLAG1(I),F1).EQ.0).AND.
  566. X  &         (and(OFLAG2(I),F2).EQ.0))) GO TO 500
  567. X        IF(FWIM.EQ.0) GO TO 400
  568. X*** dso7.F.orig    Mon Oct 24 15:28:56 1988
  569. X--- dso7.F    Mon Oct 24 15:28:56 1988
  570. X***************
  571. X*** 23,29
  572. X  C                        !UNBIAS, COMPUTE SUMS.
  573. X        UKEYW(I)=char(ichar(KEYW(I))-64)
  574. X        IF(INW(J).LE.char(64)) J=1
  575. X!       UINW(I)=ichar(ichar(INW(J))-64)
  576. X        UKEYWS=UKEYWS+ichar(UKEYW(I))
  577. X        UINWS=UINWS+UINW(I)
  578. X        J=J+1
  579. X
  580. X--- 23,29 -----
  581. X  C                        !UNBIAS, COMPUTE SUMS.
  582. X        UKEYW(I)=char(ichar(KEYW(I))-64)
  583. X        IF(INW(J).LE.char(64)) J=1
  584. X!       UINW(I)=ichar(INW(J))-64
  585. X        UKEYWS=UKEYWS+ichar(UKEYW(I))
  586. X        UINWS=UINWS+UINW(I)
  587. X        J=J+1
  588. X***************
  589. X*** 32,38
  590. X      USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
  591. X  C                        !COMPUTE MASK.
  592. X      DO 200 I=1,6
  593. X!       J=and(xor(xor(ichar(UINW(I)),ichar(UKEYW(I))),USUM),31)
  594. X        USUM=MOD(USUM+1,32)
  595. X        IF(J.GT.26) J=MOD(J,26)
  596. X        OUTW(I)=char(MAX0(1,J)+64)
  597. X
  598. X--- 32,38 -----
  599. X      USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
  600. X  C                        !COMPUTE MASK.
  601. X      DO 200 I=1,6
  602. X!       J=and(xor(xor(UINW(I),ichar(UKEYW(I))),USUM),31)
  603. X        USUM=MOD(USUM+1,32)
  604. X        IF(J.GT.26) J=MOD(J,26)
  605. X        OUTW(I)=char(MAX0(1,J)+64)
  606. X*** dsub.F.orig    Mon Oct 24 15:28:57 1988
  607. X--- dsub.F    Mon Oct 24 15:28:56 1988
  608. X***************
  609. X*** 391,401
  610. X  C                        !INVOLUNTARY EXIT.
  611. X  1100    CALL SCORE(.FALSE.)
  612. X  C                        !TELL SCORE.
  613. X! #ifdef PDP
  614. X! C    file closed in exit routine
  615. X! #else
  616. X!     CLOSE(DBCH)
  617. X! #endif PDP
  618. X      CALL EXIT
  619. X  C
  620. X      END
  621. X
  622. X--- 391,397 -----
  623. X  C                        !INVOLUNTARY EXIT.
  624. X  1100    CALL SCORE(.FALSE.)
  625. X  C                        !TELL SCORE.
  626. X! C    don't close DBCH, just exit
  627. X      CALL EXIT
  628. X  C
  629. X      END
  630. X*** dverb2.F.orig    Mon Oct 24 15:28:57 1988
  631. X--- dverb2.F    Mon Oct 24 15:28:57 1988
  632. X***************
  633. X*** 91,99
  634. X  &        SWDACT,SWDSTA,CPVEC
  635. X      WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  636. X  &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  637. X!     WRITE(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
  638. X! &        OSIZE,OCAPAC,OROOM,OADV,OCAN
  639. X!     WRITE(1) RVAL,RFLAG
  640. X      WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  641. X      WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  642. X  C
  643. X
  644. X--- 91,109 -----
  645. X  &        SWDACT,SWDSTA,CPVEC
  646. X      WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  647. X  &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  648. X!     WRITE(1) ODESC1
  649. X!     WRITE(1) ODESC2
  650. X!     WRITE(1) OFLAG1
  651. X!     WRITE(1) OFLAG2
  652. X!     WRITE(1) OFVAL
  653. X!     WRITE(1) OTVAL
  654. X!     WRITE(1) OSIZE
  655. X!     WRITE(1) OCAPAC
  656. X!     WRITE(1) OROOM
  657. X!     WRITE(1) OADV
  658. X!     WRITE(1) OCAN
  659. X!     WRITE(1) RVAL
  660. X!     WRITE(1) RFLAG
  661. X      WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  662. X      WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  663. X  C
  664. X***************
  665. X*** 195,201
  666. X      rewind (unit=1, err=100)
  667. X  C
  668. X      READ(1) I,J,K
  669. X!     IF(or((I.NE.VMAJ),(J.NE.VMIN))) GO TO 200
  670. X  C
  671. X      READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
  672. X  &        SWDACT,SWDSTA,CPVEC
  673. X
  674. X--- 205,211 -----
  675. X      rewind (unit=1, err=100)
  676. X  C
  677. X      READ(1) I,J,K
  678. X!     IF(((I.NE.VMAJ) .OR. (J.NE.VMIN))) GO TO 200
  679. X  C
  680. X      READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
  681. X  &        SWDACT,SWDSTA,CPVEC
  682. X***************
  683. X*** 201,209
  684. X  &        SWDACT,SWDSTA,CPVEC
  685. X      READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  686. X  &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  687. X!     READ(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
  688. X! &        OSIZE,OCAPAC,OROOM,OADV,OCAN
  689. X!     READ(1) RVAL,RFLAG
  690. X      READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  691. X      READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  692. X  C
  693. X
  694. X--- 211,229 -----
  695. X  &        SWDACT,SWDSTA,CPVEC
  696. X      READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  697. X  &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  698. X!     READ(1) ODESC1
  699. X!     READ(1) ODESC2
  700. X!     READ(1) OFLAG1
  701. X!     READ(1) OFLAG2
  702. X!     READ(1) OFVAL
  703. X!     READ(1) OTVAL
  704. X!     READ(1) OSIZE
  705. X!     READ(1) OCAPAC
  706. X!     READ(1) OROOM
  707. X!     READ(1) OADV
  708. X!     READ(1) OCAN
  709. X!     READ(1) RVAL
  710. X!     READ(1) RFLAG
  711. X      READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  712. X      READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  713. X  C
  714. X***************
  715. X*** 421,427
  716. X  C
  717. X  C C7-    FROBOZZ FLAG (BANK ALARM)
  718. X  C
  719. X! 7000    FROBZF=and((OROOM(BILLS).NE.0),(OROOM(PORTR).NE.0))
  720. X      RETURN
  721. X  C CXAPPL, PAGE 3
  722. X  C
  723. X
  724. X--- 441,447 -----
  725. X  C
  726. X  C C7-    FROBOZZ FLAG (BANK ALARM)
  727. X  C
  728. X! 7000    FROBZF=((OROOM(BILLS).NE.0) .AND. (OROOM(PORTR).NE.0))
  729. X      RETURN
  730. X  C CXAPPL, PAGE 3
  731. X  C
  732. X*** exit.c.orig    Mon Oct 24 15:28:57 1988
  733. X--- exit.c    Mon Oct 24 15:28:57 1988
  734. X***************
  735. X*** 0
  736. X
  737. X--- 1 -----
  738. X+ void exit_() { exit(0); }
  739. X*** gdt.F.orig    Mon Oct 24 15:28:58 1988
  740. X--- gdt.F    Mon Oct 24 15:28:58 1988
  741. X***************
  742. X*** 102,108
  743. X      GO TO 2000
  744. X  C
  745. X  #ifdef NOCC
  746. X! 200    FORMAT('GDT>',$)
  747. X  #else NOCC
  748. X  200    FORMAT(' GDT>',$)
  749. X  #endif NOCC
  750. X
  751. X--- 102,108 -----
  752. X      GO TO 2000
  753. X  C
  754. X  #ifdef NOCC
  755. X! 200    FORMAT('GDT>')
  756. X  #else NOCC
  757. X  200    FORMAT(' GDT>',$)
  758. X  #endif NOCC
  759. X***************
  760. X*** 115,123
  761. X  230    FORMAT(2I6)
  762. X  240    FORMAT(I6)
  763. X  #ifdef NOCC
  764. X! 225    FORMAT('Limits:   ',$)
  765. X! 235    FORMAT('Entry:    ',$)
  766. X! 245    FORMAT('Idx,Ary:  ',$)
  767. X  #else NOCC
  768. X  225    FORMAT(' Limits:   ',$)
  769. X  235    FORMAT(' Entry:    ',$)
  770. X
  771. X--- 115,123 -----
  772. X  230    FORMAT(2I6)
  773. X  240    FORMAT(I6)
  774. X  #ifdef NOCC
  775. X! 225    FORMAT('Limits:   ')
  776. X! 235    FORMAT('Entry:    ')
  777. X! 245    FORMAT('Idx,Ary:  ')
  778. X  #else NOCC
  779. X  225    FORMAT(' Limits:   ',$)
  780. X  235    FORMAT(' Entry:    ',$)
  781. X***************
  782. X*** 344,350
  783. X      GO TO 2000
  784. X  C
  785. X  #ifdef NOCC
  786. X! 480    FORMAT('Old=',L2,6X,'New= ',$)
  787. X  #else NOCC
  788. X  480    FORMAT(' Old=',L2,6X,'New= ',$)
  789. X  #endif NOCC
  790. X
  791. X--- 344,350 -----
  792. X      GO TO 2000
  793. X  C
  794. X  #ifdef NOCC
  795. X! 480    FORMAT('Old=',L2,6X,'New= ')
  796. X  #else NOCC
  797. X  480    FORMAT(' Old=',L2,6X,'New= ',$)
  798. X  #endif NOCC
  799. X***************
  800. X*** 528,534
  801. X      GO TO 2000
  802. X  C
  803. X  #ifdef NOCC
  804. X! 590    FORMAT('Old= ',I6,6X,'New= ',$)
  805. X  #else NOCC
  806. X  590    FORMAT(' Old= ',I6,6X,'New= ',$)
  807. X  #endif NOCC
  808. X
  809. X--- 528,534 -----
  810. X      GO TO 2000
  811. X  C
  812. X  #ifdef NOCC
  813. X! 590    FORMAT('Old= ',I6,6X,'New= ')
  814. X  #else NOCC
  815. X  590    FORMAT(' Old= ',I6,6X,'New= ',$)
  816. X  #endif NOCC
  817. X***************
  818. X*** 574,580
  819. X      GO TO 2000
  820. X  C
  821. X  #ifdef NOCC
  822. X! 610    FORMAT('Old= ',I6,6X,'New= ',$)
  823. X  #else NOCC
  824. X  610    FORMAT(' Old= ',I6,6X,'New= ',$)
  825. X  #endif NOCC
  826. X
  827. X--- 574,580 -----
  828. X      GO TO 2000
  829. X  C
  830. X  #ifdef NOCC
  831. X! 610    FORMAT('Old= ',I6,6X,'New= ')
  832. X  #else NOCC
  833. X  610    FORMAT(' Old= ',I6,6X,'New= ',$)
  834. X  #endif NOCC
  835. X*** np.F.orig    Mon Oct 24 15:28:58 1988
  836. X--- np.F    Mon Oct 24 15:28:58 1988
  837. X***************
  838. X*** 25,31
  839. X  10    WRITE(OUTCH,50)
  840. X  C                        !PROMPT FOR GAME.
  841. X  #ifdef NOCC
  842. X! 50    FORMAT('>',$)
  843. X  #else NOCC
  844. X  50    FORMAT(' >',$)
  845. X  #endif NOCC
  846. X
  847. X--- 25,31 -----
  848. X  10    WRITE(OUTCH,50)
  849. X  C                        !PROMPT FOR GAME.
  850. X  #ifdef NOCC
  851. X! 50    FORMAT('>')
  852. X  #else NOCC
  853. X  50    FORMAT(' >',$)
  854. X  #endif NOCC
  855. X***************
  856. X*** 30,36
  857. X  50    FORMAT(' >',$)
  858. X  #endif NOCC
  859. X  
  860. X! 90    READ(INPCH,100, END=210) BUFFER
  861. X  100    FORMAT(78A1)
  862. X  
  863. X      DO 200 LENGTH=78,1,-1
  864. X
  865. X--- 30,36 -----
  866. X  50    FORMAT(' >',$)
  867. X  #endif NOCC
  868. X  
  869. X! 90    READ(INPCH,100,END=210) (BUFFER(LENGTH),LENGTH=1,78)
  870. X  100    FORMAT(78A1)
  871. X  
  872. X      DO 200 LENGTH=78,1,-1
  873. X***************
  874. X*** 38,44
  875. X  200    CONTINUE
  876. X      GO TO 5
  877. X  C                        !END OF FILE
  878. X! 210    STOP
  879. X  C                        !TRY AGAIN.
  880. X  
  881. X  C
  882. X
  883. X--- 38,44 -----
  884. X  200    CONTINUE
  885. X      GO TO 5
  886. X  C                        !END OF FILE
  887. X! 210    CALL EXIT
  888. X  C                        !TRY AGAIN.
  889. X  
  890. X  C
  891. X***************
  892. X*** 55,61
  893. X  
  894. X  C CONVERT TO UPPER CASE
  895. X  300    DO 400 I=1,LENGTH
  896. X!        IF(and((BUFFER(I).GE.'a'),(BUFFER(I).LE.'z')))
  897. X  &        BUFFER(I)=char(ichar(BUFFER(I))-32)
  898. X  400    CONTINUE
  899. X  #endif PDP
  900. X
  901. X--- 55,61 -----
  902. X  
  903. X  C CONVERT TO UPPER CASE
  904. X  300    DO 400 I=1,LENGTH
  905. X!        IF(((BUFFER(I).GE.'a') .AND. (BUFFER(I).LE.'z')))
  906. X  &        BUFFER(I)=char(ichar(BUFFER(I))-32)
  907. X  400    CONTINUE
  908. X  #endif PDP
  909. X***************
  910. X*** 105,111
  911. X  C                        !ECHO MODE, FORCE FAIL.
  912. X      IF(.NOT.SYNMCH(X)) GO TO 100
  913. X  C                        !DO SYN MATCH.
  914. X!     IF(and((PRSO.GT.0),(PRSO.LT.XMIN))) LASTIT=PRSO
  915. X  C
  916. X  C SUCCESSFUL PARSE OR SUCCESSFUL VALIDATION
  917. X  C
  918. X
  919. X--- 105,111 -----
  920. X  C                        !ECHO MODE, FORCE FAIL.
  921. X      IF(.NOT.SYNMCH(X)) GO TO 100
  922. X  C                        !DO SYN MATCH.
  923. X!     IF(((PRSO.GT.0) .AND. (PRSO.LT.XMIN))) LASTIT=PRSO
  924. X  C
  925. X  C SUCCESSFUL PARSE OR SUCCESSFUL VALIDATION
  926. X  C
  927. X***************
  928. X*** 207,213
  929. X  C                        !SPACE?
  930. X      DO 500 I=1,9,3
  931. X  C                        !SCH FOR CHAR.
  932. X!       IF(and((J.GE.DLIMIT(I)),(J.LE.DLIMIT(I+1))))
  933. X  &        GO TO 4000
  934. X  500    CONTINUE
  935. X  C
  936. X
  937. X--- 207,213 -----
  938. X  C                        !SPACE?
  939. X      DO 500 I=1,9,3
  940. X  C                        !SCH FOR CHAR.
  941. X!       IF(((J.GE.DLIMIT(I)) .AND. (J.LE.DLIMIT(I+1))))
  942. X  &        GO TO 4000
  943. X  500    CONTINUE
  944. X  C
  945. X***************
  946. X*** 219,225
  947. X  C
  948. X  1000    IF(PRSCON.GT.INLNT) PRSCON=1
  949. X  C                        !FORCE PARSE RESTART.
  950. X!     IF(and((CP.EQ.0),(OP.EQ.1))) RETURN
  951. X      IF(CP.EQ.0) OP=OP-2
  952. X  C                        !ANY LAST WORD?
  953. X      LEX=.TRUE.
  954. X
  955. X--- 219,225 -----
  956. X  C
  957. X  1000    IF(PRSCON.GT.INLNT) PRSCON=1
  958. X  C                        !FORCE PARSE RESTART.
  959. X!     IF(((CP.EQ.0) .AND. (OP.EQ.1))) RETURN
  960. X      IF(CP.EQ.0) OP=OP-2
  961. X  C                        !ANY LAST WORD?
  962. X      LEX=.TRUE.
  963. X*** sverbs.F.orig    Mon Oct 24 15:28:59 1988
  964. X--- sverbs.F    Mon Oct 24 15:28:58 1988
  965. X***************
  966. X*** 293,303
  967. X  C                        !TELLL SCORE.
  968. X      IF(.NOT.YESNO(343,0,0)) RETURN
  969. X  C                        !ASK FOR Y/N DECISION.
  970. X! #ifdef PDP
  971. X! C    close routine moved to exit for pdp version
  972. X! #else
  973. X!     CLOSE (DBCH)
  974. X! #endif PDP
  975. X      CALL EXIT
  976. X  C                        !BYE.
  977. X  C SVERBS, PAGE 4
  978. X
  979. X--- 293,299 -----
  980. X  C                        !TELLL SCORE.
  981. X      IF(.NOT.YESNO(343,0,0)) RETURN
  982. X  C                        !ASK FOR Y/N DECISION.
  983. X! C    don't close DBCH, just exit
  984. X      CALL EXIT
  985. X  C                        !BYE.
  986. X  C SVERBS, PAGE 4
  987. X
  988. X
  989. END_OF_FILE
  990. if test 26146 -ne `wc -c <'SysVR3.pch'`; then
  991.     echo shar: \"'SysVR3.pch'\" unpacked with wrong size!
  992. fi
  993. # end of 'SysVR3.pch'
  994. fi
  995. echo shar: End of shell archive.
  996. exit 0
  997.